/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * THIS FILE IS AUTOGENERATED BY arktscgen v2.1.9-arktscgen-6. DO NOT EDIT MANUALLY!
 * es2panda fe7c2bfd7c50a1bef62bcedaac78ba82000e6c39(2025-07-10) sdk v1.5.0-dev.36516
 */

import {
    global,
    passNode,
    passNodeArray,
    unpackNonNullableNode,
    unpackNode,
    unpackNodeArray,
    assertValidPeer,
    AstNode,
    KNativePointer,
    nodeByType,
    ArktsObject,
    unpackString
} from "../../reexport-for-generated"

import { ClassDefinition } from "./ClassDefinition"
import { Decorator } from "./Decorator"
import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
import { Identifier } from "./Identifier"
import { TypeNode } from "./TypeNode"
import { TypedStatement } from "./TypedStatement"

export class TSEnumDeclaration extends TypedStatement {
    constructor(pointer: KNativePointer) {
        assertValidPeer(pointer, 89)
        super(pointer)
    }
    static create1TSEnumDeclaration(key: Identifier | undefined, members: readonly AstNode[], isConst: boolean, isStatic: boolean, isDeclare: boolean, typeNode?: TypeNode): TSEnumDeclaration {
        const result: TSEnumDeclaration = new TSEnumDeclaration(global.generatedEs2panda._CreateTSEnumDeclaration1(global.context, passNode(key), passNodeArray(members), members.length, isConst, isStatic, isDeclare, passNode(typeNode)))
        result.setChildrenParentPtr()
        return result
    }
    static updateTSEnumDeclaration(original: TSEnumDeclaration | undefined, key: Identifier | undefined, members: readonly AstNode[], isConst: boolean, isStatic: boolean, isDeclare: boolean): TSEnumDeclaration {
        const result: TSEnumDeclaration = new TSEnumDeclaration(global.generatedEs2panda._UpdateTSEnumDeclaration(global.context, passNode(original), passNode(key), passNodeArray(members), members.length, isConst, isStatic, isDeclare))
        result.setChildrenParentPtr()
        return result
    }
    static update1TSEnumDeclaration(original: TSEnumDeclaration | undefined, key: Identifier | undefined, members: readonly AstNode[], isConst: boolean, isStatic: boolean, isDeclare: boolean, typeNode?: TypeNode): TSEnumDeclaration {
        const result: TSEnumDeclaration = new TSEnumDeclaration(global.generatedEs2panda._UpdateTSEnumDeclaration1(global.context, passNode(original), passNode(key), passNodeArray(members), members.length, isConst, isStatic, isDeclare, passNode(typeNode)))
        result.setChildrenParentPtr()
        return result
    }
    get typeNodes(): TypeNode | undefined {
        return unpackNode(global.generatedEs2panda._TSEnumDeclarationTypeNodes(global.context, this.peer))
    }
    get key(): Identifier | undefined {
        return unpackNode(global.generatedEs2panda._TSEnumDeclarationKey(global.context, this.peer))
    }
    get members(): readonly AstNode[] {
        return unpackNodeArray(global.generatedEs2panda._TSEnumDeclarationMembersConst(global.context, this.peer))
    }
    get internalName(): string {
        return unpackString(global.generatedEs2panda._TSEnumDeclarationInternalNameConst(global.context, this.peer))
    }
    /** @deprecated */
    setInternalName(internalName: string): this {
        global.generatedEs2panda._TSEnumDeclarationSetInternalName(global.context, this.peer, internalName)
        return this
    }
    get boxedClass(): ClassDefinition | undefined {
        return unpackNode(global.generatedEs2panda._TSEnumDeclarationBoxedClassConst(global.context, this.peer))
    }
    /** @deprecated */
    setBoxedClass(boxedClass?: ClassDefinition): this {
        global.generatedEs2panda._TSEnumDeclarationSetBoxedClass(global.context, this.peer, passNode(boxedClass))
        return this
    }
    get isConst(): boolean {
        return global.generatedEs2panda._TSEnumDeclarationIsConstConst(global.context, this.peer)
    }
    get decorators(): readonly Decorator[] {
        return unpackNodeArray(global.generatedEs2panda._TSEnumDeclarationDecoratorsConst(global.context, this.peer))
    }
    /** @deprecated */
    emplaceDecorators(source?: Decorator): this {
        global.generatedEs2panda._TSEnumDeclarationEmplaceDecorators(global.context, this.peer, passNode(source))
        return this
    }
    /** @deprecated */
    clearDecorators(): this {
        global.generatedEs2panda._TSEnumDeclarationClearDecorators(global.context, this.peer)
        return this
    }
    /** @deprecated */
    setValueDecorators(source: Decorator | undefined, index: number): this {
        global.generatedEs2panda._TSEnumDeclarationSetValueDecorators(global.context, this.peer, passNode(source), index)
        return this
    }
    get decoratorsForUpdate(): readonly Decorator[] {
        return unpackNodeArray(global.generatedEs2panda._TSEnumDeclarationDecoratorsForUpdate(global.context, this.peer))
    }
    /** @deprecated */
    emplaceMembers(source?: AstNode): this {
        global.generatedEs2panda._TSEnumDeclarationEmplaceMembers(global.context, this.peer, passNode(source))
        return this
    }
    /** @deprecated */
    clearMembers(): this {
        global.generatedEs2panda._TSEnumDeclarationClearMembers(global.context, this.peer)
        return this
    }
    /** @deprecated */
    setValueMembers(source: AstNode | undefined, index: number): this {
        global.generatedEs2panda._TSEnumDeclarationSetValueMembers(global.context, this.peer, passNode(source), index)
        return this
    }
    get membersForUpdate(): readonly AstNode[] {
        return unpackNodeArray(global.generatedEs2panda._TSEnumDeclarationMembersForUpdate(global.context, this.peer))
    }
    protected readonly brandTSEnumDeclaration: undefined
}
export function isTSEnumDeclaration(node: object | undefined): node is TSEnumDeclaration {
    return node instanceof TSEnumDeclaration
}
if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_TS_ENUM_DECLARATION)) {
    nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_TS_ENUM_DECLARATION, (peer: KNativePointer) => new TSEnumDeclaration(peer))
}
